package satir.card.factory;

import org.json.JSONException;
import satir.card.AccomplishToolCard;
import satir.card.Card;

/**
 * A factory for creating AccomplishToolCard objects.
 * @version 3.0 April 2012
 * @author Creative Family
 */
public class AccomplishToolCardFactory extends CardFactory {

    /**
     * Break down the structure of cardJson to retrieve required data And then
     * create AccomplishToolCard.
     * @return Instance of AccomplishToolCard
     */
    @Override
    public Card createCard() {
	String key = "";
	String name = "";
	String targetCard = "";
	try {
	    targetCard = cardJson.getString("targetCard");
	    key = cardJson.getString("key");
	    name = cardJson.getString("name");
	} catch (JSONException e) {
	    e.printStackTrace();
	}
	return new AccomplishToolCard(key, name, targetCard);
    }

}
